//
//  ControlTemplateViewController.h
//  Uhomebk
//
//  Created by XXJ on 15/12/11.
//  Copyright © 2015年 com.segi. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void(^checkPartolOrDeviceFinishCallBack)(BOOL isCheckPass);

typedef void(^uploadFilesResultCallBack)(BOOL isSucessed,NSString *message);

@protocol ControlTemplateViewControllerDelegate <NSObject>

@optional

-(void)onFeeRefeshUI;


/**
 点击设备计划控件事件回调
 */
-(void)controlTemplateViewControllerClickDeviceControlTemplateAction:(NSDictionary *)dict;


@end


@interface ControlTemplateViewController : UIViewController
{
    BOOL    isSuccess;
    NSOperationQueue *queue;
    
}
@property (nonatomic, weak) id<ControlTemplateViewControllerDelegate> fundelegate;
@property (nonatomic, strong) UIViewController          *mastVC;
@property (nonatomic, strong) NSMutableArray            *vcArray;       /**<视图数组*/
@property (nonatomic, assign) CGFloat  tempViewHeight;  //模板列表高度
@property (nonatomic, assign) NSString *  handletype;
@property (nonatomic, assign) CGFloat defaultHeight;//默认高度 - 兼容工单录入详情表单预约功能,其他页面不赋值

@property (nonatomic, assign) id                        shareaScrollView;

@property(nonatomic,strong) NSMutableArray *deal_vcArray;//处理界面视图组数
@property (nonatomic, assign) CGFloat  deal_tempViewHeight;  //处理界面模板列表高度
@property(nonatomic,assign) id deal_shareaScrollView; //处理界面scrollView

@property(nonatomic,strong) NSDictionary *userInfo;//业主信息

@property(nonatomic,strong) NSString *communityId;//工单所属小区Id

@property(nonatomic,strong) NSString *orderId;//工单id

@property(nonatomic,strong) NSArray *otherDataArr;//请假单控件数据

@property(nonatomic,strong) NSString *houseId;//房屋选择控件特殊处理,用于提交工单

@property(nonatomic,strong) NSString *houseInfo;

@property(nonatomic,strong) NSString *evaluateValue;//评论控件特殊处理。>3时发布赞赞

/**
 *  巡更设备完成检测程序
 *
 *
 */
-(void)checkDevice;

#pragma mark - ================<定制化版方法  start>===============

/**
 定制化版本的图片上传

 @param dict 控件参数
 @param uploadResult 图片上传结果回调
 */
-(void)SEGUploadFileControlTemplate:(NSDictionary *)dict uploadResult:(uploadFilesResultCallBack)uploadResult;



@property(nonatomic,copy)checkPartolOrDeviceFinishCallBack finishBlock;
@property(nonatomic,copy)uploadFilesResultCallBack uploadResult;
#pragma mark - ================<定制化版方法  end>===============

/**
 *  生成控件函数
 *
 *  @param array 接收数组数据字典
 *  @param view 添加控件视图
 *
 */

-(void)onCreateTemplateView:(NSArray *)array view:(UIView *)view;

-(void)onCreateTemplateWithHandleType:(NSString *)type dataArr:(NSArray *)array view:(UIView *)view;

/**
 *  返回所有控件值
 *  @param checkRequired - 是否检测控件必填  YES - 检测  NO-不检测
 *  @return 返回数据字典
 */
- (NSDictionary*)onReponseTemplateValueWithCheckRequired:(BOOL)checkRequired;


/**
 *  向控件中填充数据
 *
 *  @param data 接收任意型，默认json
 */
-(void)paddingOrderDetail:(id)data;

/**
 *  上传图片和录音文件
 *
 *  @param params 接收保存值的数据字典
 */
-(void)uploadFileControlTemplate:(NSDictionary *)params;

//选择资源完后
-(void)selectResourceFinishWithResInstId:(NSString *)resInstId;


@end










